<?php 

include '../function.php';

$mysqli = @new mysqli("127.0.0.1", "root", "", "school");


if($mysqli->connect_errno){
	exit("数据链接失败：原因：".$mysqli->connect_errno.":".$mysqli->connect_error);
}

$mysqli->query("set names utf8");



$sql = "delete from stu where sid >15";


// $sql = "select * from stu";

$time1 = microtime(true);

echo $time1 ."<br>";

for ($i=0; $i <1000 ; $i++) { 

	$sql = "insert into stu (name,age) values('小明".$i."',".$i.")";
	$res = $mysqli->query($sql);
	
}

echo microtime(true)-$time1;


//24.996201038361
//28.128529071808
//23.393301963806
//24.977530002594

// $res = $mysqli->query($sql);

exit;
if(!$res){
	exit("数据链接失败：原因：".$mysqli->errno.":".$mysqli->error);
}



$tempArr = array();


while ($row = $res->fetch_assoc()) {
	$tempArr [] = $row;
}


var_dump($tempArr);


$res->free();
$mysqli->close();























 ?>